﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PrintOrder.aspx.cs" Inherits="Admin_PrintOrder" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>打印订单</title>
    <object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"
        width="0">
    </object>
    <script src="../Scripts/gz-1.7.2.min.js" type="text/javascript"></script>
    <style type="text/css" media="print">
        .noprint
        {
            display: none;
        }
    </style>
    <script language="vbscript" type="text/vbscript">
        sub print1()      
              WebBrowser.ExecWB 6,2,3 
             WebBrowser.ExecWB 6,2,3 
        End Sub   
    </script>
    <script language="javascript" type="text/javascript">
        //打印
        function print(orderid) {
            //WebBrowser.ExecWB(7, 1);
            $.ajax({
                async: false,
                url: "../ajax/ajaxorder.ashx?methodName=PrintOrder&orderid=" + orderid,
                type: "GET",
                success: function (data, status) {
                    if (data = "ok") {
                        print1();
                        window.opener.location.reload();
                        self.close();
                    }
                    else {
                        alert("操作失败，请联系技术");
                    }
                }
            });

        }
          
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 250px">
            <tr style="height: 27px">
                <td colspan="2">
                    <strong><span style="font-size: 20px; font-family: 微软雅黑">果之Juice Shop 订购清单</span></strong>
                </td>
            </tr>
            <tr>
                <td style="width: 30%">
                    <strong>订单号:</strong>
                </td>
                <td>
                    <%=OrderId%>
                </td>
            </tr>
            <tr>
                <td>
                    <strong>地&nbsp;&nbsp;&nbsp;&nbsp;址:</strong>
                </td>
                <td>
                    <%=RegionId + BusinessDistrictId + OfficeId + FloorId + Address%>
                </td>
            </tr>
            <tr>
                <td>
                    <strong>订购人:</strong>
                </td>
                <td>
                    <%=CustomerName +" "+ TelNum%>
                </td>
            </tr>
            <tr>
                <td>
                    <strong>配送日期</strong>
                </td>
                <td>
                    <%=DeliveryDate%>
                </td>
            </tr>
            <tr>
                <td>
                    <strong>配送时间</strong>
                </td>
                <td>
                    <%=DeliveryPeriodId%>
                </td>
            </tr>
            <tr style="height: 5px;">
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <table style="width: 250px">
            <tr>
                <td style="width: 60%">
                    <strong>商品名</strong>
                </td>
                <td style="width: 20%">
                    <strong>数量</strong>
                </td>
                <td style="width: 20%">
                    <strong>单价</strong>
                </td>
            </tr>
            <asp:Repeater ID="rptOrderList" runat="server">
                <ItemTemplate>
                    <tr>
                        <td>
                            <%#Eval("ProductName") %>
                        </td>
                        <td align="center">
                            <%#Eval("Cnt") %>
                        </td>
                        <td>
                            ￥<%#Eval("Price") %></td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            <tr style="height: 8px;">
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <strong>总金额</strong>
                </td>
                <td align="right">
                    <strong><span style="font-size: 20px">￥<%=OrderAmount%></span></strong>
                </td>
                <td>
                </td>
            </tr>
            <tr style="height: 8px;">
                <td><strong>付款方式：</strong>
                </td>
                <td colspan="2"><strong><span style="font-size: 20px"><%=PaymentType%></span></strong>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    订购网址：www.guozhi321.com
                    <br />
                    订购电话：010-84606995
                </td>
            </tr>
            <tr>
                <td>
                    <input id="btnPrint" class="noprint" type="button" onclick='javascript:print(<%=OrderId%>);'
                        value="打印" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
